home *** CD-ROM | disk | FTP | other *** search
/ The Ultimate Guide to Advanture Travel / The Ultimate Guide to Advanture Travel.iso / pc / installa.6 / Online Files / Datapac < prev    next >
Text File  |  1995-07-10  |  13KB  |  432 lines

  1. !*****************************************************************************
  2. !   C O P Y R I G H T   A N D   C O N F I D E N T I A L I T Y   N O T I C E
  3. !*****************************************************************************
  4. !
  5. !      Copyright © 1987-1994 America Online, Inc.  All rights reserved.
  6. !      This software contains valuable confidential and proprietary
  7. !      information of America Online, Inc. and is subject to applicable
  8. !      licensing agreements.  Unauthorized reproduction, transmission or
  9. !      distribution of this file and its contents is a violation of
  10. !      applicable laws.
  11. !
  12. !            A M E R I C A   O N L I N E   C O N F I D E N T I A L
  13. !
  14. !*****************************************************************************
  15.  
  16. !-------------------------------------------------------------------
  17. !   DATAPAC.ALCL
  18. !   By: David Steinberg
  19. !   Phone = (403) 265-8292  (Canada - 2400 baud)
  20. !           (403) 429-4368  (Canada - 2400 baud)
  21. !
  22. !
  23. !   Date: June 20, 1989
  24. !   Rev: 5.10
  25. !   Changed 9/18/89 by DMC to request Hayes extended commandset
  26. !   Changed 9/19/89 by DMC to report error codes, 
  27. !      and report busy signal as a seperate error
  28. !   Changed 7/30/91 to use new modem string, setup, 
  29. !      shutdown, phone prefix, system sub-address, and call waiting strings
  30. !  Changed 2/23/93 by LMD to use new matchstr format.
  31. !  Adding support for modem personality module CCL variables. - RG, 10/06/93
  32. !  Adding pauses before and after "+++" command. - RG, 1/21/94
  33. !  Adding new and improved connection messages. - RG, 2/23/94
  34. !--------------------------------------------------
  35. !
  36. ! Connect Sequence:
  37. !
  38. -LABEL 0
  39. CanBtn "19"               { if cancel button - just exit }
  40. Jsr "CheckPhoneLength"
  41. CheckPort "19" ~PORT
  42. DsplyMsg "Step 1:  Initializing modem"
  43. SetTries 0
  44. ChrDelay 2
  45. SerReset ~BAUD 0 8 1
  46.  
  47. IfEq Handshake 0
  48.     Jump "TurnHandshakeOff"
  49.     
  50. -Label TurnHandshakeOn    
  51. IfEq HH_ON ""
  52.     Jump "TurnHandshakeOff"
  53.  
  54. HSReset 0 1 17 19
  55. Jump "WakeUpModem"
  56.     
  57. -Label TurnHandshakeOff    
  58. HSReset 0 0 17 19
  59.  
  60. -Label WakeUpModem
  61. DsplyPic 1
  62. !
  63. !----------------------------------
  64. !
  65. -LABEL 1                { wake up the modem }
  66. Flush
  67. !-----------------------------------                        
  68. ZMIT "2" "$INIT$\0D"         { Send modem string; jump to 4 if empty}
  69. Pause 40            { Allow modem to settle between commands.}
  70. !
  71. -Label 2
  72. !
  73. ! *No longer allow +++ echoed as proof of initialization.*
  74. IfTries 0 "3"             { Only do this if we need to }
  75. ClrMchStr
  76. MatchStr "3" "OK"         
  77. MatchStr "3" ">"          { Special case for Avatex 1200 modems}
  78. MatchStr "3" "0\0D"       { Verbose is grandiose but terse ain't worse }
  79. !
  80. Pause 180               { Pause for 3 sec min gap }
  81. Xmit "+++"              { Get the modems attention}
  82. Pause 180               { Pause for 3 sec min gap }
  83. Xmit "$ATTENTION$H\0D"            {Hang up, just in case we were online}
  84. Wait 60                { Pause for 2 seconds, minimum gap required}
  85. !
  86. -Label 3 
  87. !-----------------------------------
  88. -LABEL 4                { just saw 'OK'- Set up modem }
  89. Flush
  90. !
  91. ClrMchStr
  92. MatchStr "5" "OK"         { We'd better be getting responses by now. }
  93. MatchStr "38" "ERROR"     { If not, something is wrong - we're gone. }
  94. MatchStr "5" ">"          {Special case for Avatex 1200}
  95. !
  96. Pause 40            { Allow modem to settle between commands.}
  97. IfEq Handshake 0
  98.   ZMIT "5" "$ATTENTION$$HH_OFF$$CONFIG$\0D"  { Send modem string; jump if empty}
  99. Else
  100.   ZMIT "5" "$ATTENTION$$HH_ON$$CONFIG$\0D"  { Send modem string; jump if empty}
  101. Wait 120                { Two seconds to get it right. }
  102. IncTries
  103. IfTries 1 1             { Try 1: Reset modem.  Try 2: Hang up/reset }
  104. Jump "33"
  105. !-----------------------------------
  106. -LABEL 5                { Now try to dial }
  107. DsplyMsg "Step 2:  Dialing ~PREF~NOCW~FONE"
  108. !
  109. ClrMchStr
  110. MatchStr "Got57600" "CONNECT 57600"
  111. MatchStr "Got38400" "CONNECT 38400"
  112. MatchStr "Got28800" "CONNECT 28800"
  113. MatchStr "Got26400" "CONNECT 26400"
  114. MatchStr "Got24000" "CONNECT 24000"
  115. MatchStr "Got21600" "CONNECT 21600"
  116. MatchStr "Got19200" "CONNECT 19200"
  117. MatchStr "Got16800" "CONNECT 16800"
  118. MatchStr "Got14400" "CONNECT 14400"
  119. MatchStr "Got12000" "CONNECT 12000"
  120. MatchStr "Got9600" "CONNECT 9600"
  121. MatchStr "Got4800" "CONNECT 4800"    
  122. MatchStr "Got2400" "CONNECT 2400\0D"    
  123. MatchStr "Got2400" "CONNECT 2400 "    
  124. MatchStr "Got2400" "CONNECT 2400/"    
  125. MatchStr "Got1200" "CONNECT 1200\0D"
  126. MatchStr "Got1200" "CONNECT 1200 "
  127. MatchStr "Got1200" "CONNECT 1200/"
  128. MatchStr "Got300" "CONNECT 300"
  129. MatchStr "Got300" "CONNECT\0D"     {assume "CONNECT" means the current baud rate}
  130. MatchStr "33" "NO DIAL"          
  131. MatchStr "27" "NO ANSWER"      
  132. MatchStr "27" "VOICE"           
  133. MatchStr "27" "NO CARRIER"     
  134. MatchStr "26" "BUSY"
  135. MatchStr "38" "ERROR"
  136. !
  137. SetTries 0
  138. CanBtn "18"               { if cancel button hit, hangUp then exit }
  139. Pause 30
  140. Xmit "$ATTENTION$D~TONE~PREF~NOCW~FONE\0D"
  141. !                       { jump to label #13 if match }
  142. Wait 2400               { wait 40 seconds for CONNECT msg from modem }
  143. !
  144. !
  145. ! This CCL section formerly checked for "300" through "9600" for
  146. ! no apparent reason - we do not support MNP connections and we'd
  147. ! never see that response string at this point anyway.
  148. !
  149. Jump "27"                { else hang up phone & exit  }
  150. !
  151. !-----------------------------------
  152. !
  153. -Label Got300
  154. DsplyMsg "Step 3:  Connecting at 300 bps"
  155. SetSpeed 300
  156. Jump "12"
  157. !
  158. -Label Got1200
  159. DsplyMsg "Step 3:  Connecting at 1200 bps"
  160. SetSpeed 1200
  161. Jump "12"
  162. !
  163. -Label Got2400
  164. DsplyMsg "Step 3:  Connecting at 2400 bps"
  165. SetSpeed 2400
  166. Jump "12"
  167. !
  168. -Label Got4800
  169. DsplyMsg "Step 3:  Connecting at 4800 bps"
  170. SetSpeed 4800
  171. Jump "12"
  172. !
  173. -Label Got9600
  174. DsplyMsg "Step 3:  Connecting at 9600 bps"
  175. SetSpeed 9600
  176. Jump "12"
  177. !
  178. -Label Got12000
  179. DsplyMsg "Step 3:  Connecting at 12000 bps"
  180. SetSpeed 12000
  181. Jump "12"
  182. !
  183. -Label Got14400
  184. DsplyMsg "Step 3:  Connecting at 14400 bps"
  185. SetSpeed 14400
  186. Jump "12"
  187. !
  188. -Label Got16800
  189. DsplyMsg "Step 3:  Connecting at 16800 bps"
  190. SetSpeed 16800
  191. Jump "12"
  192. !
  193. -Label Got19200
  194. DsplyMsg "Step 3:  Connecting at 19200 bps"
  195. SetSpeed 19200
  196. Jump "12"
  197. !
  198. -Label Got21600
  199. DsplyMsg "Step 3:  Connecting at 21600 bps"
  200. SetSpeed 21600
  201. Jump "12"
  202. !
  203. -Label Got24000
  204. DsplyMsg "Step 3:  Connecting at 24000 bps"
  205. SetSpeed 24000
  206. Jump "12"
  207. !
  208. -Label Got26400
  209. DsplyMsg "Step 3:  Connecting at 26400 bps"
  210. SetSpeed 26400
  211. Jump "12"
  212. !
  213. -Label Got28800
  214. DsplyMsg "Step 3:  Connecting at 28800 bps"
  215. SetSpeed 28800
  216. Jump "12"
  217. !
  218. -Label Got38400
  219. DsplyMsg "Step 3:  Connecting at 38400 bps"
  220. SetSpeed 38400
  221. Jump "12"
  222. !
  223. -Label Got57600
  224. DsplyMsg "Step 3:  Connecting at 57600 bps"
  225. SetSpeed 57600
  226. Jump "12"
  227. !
  228. !
  229. !
  230. !----------------------------------------------------------------------
  231. !
  232. -LABEL 12               { Modem just sent 'CONNECT' message }
  233. DsplyPic 2
  234. Pause 60                {  Need some dead time. }
  235. ChrDelay 20      
  236. !  
  237. !      
  238. -LABEL 13               {  Establishing Connection }
  239. ClrMchStr
  240. MatchStr "15" "DATAPAC:"        
  241. !
  242. DsplyMsg "Step 4:  Requesting network attention"
  243. Xmit "..\0D"
  244. Wait 240              {Try to sync up to four times}
  245. IncTries
  246. IfTries 4 "32"
  247. Jump "13"
  248. !
  249. !----------------------------------------------------------------------
  250. !
  251. -LABEL 15           Sending Identifier    
  252. !                         
  253. !
  254. ChrDelay 2
  255. ClrMchStr
  256. MatchStr "16" "CALL CONNECTED"
  257. MatchStr "17" "PACKET SIZE:"
  258. DsplyMsg "Step 5:  Talking to network"
  259. Xmit "~DPC1~SUBA,mac aol 0001\0D"
  260. !
  261. DsplyMsg "Step 6:  Connecting to America Online"
  262. Wait 960
  263. Jump "32"
  264. !
  265. -LABEL 16 
  266. ClrMchStr
  267. MatchStr "17" "PACKET SIZE:"
  268. Wait 960          {Pause for datapac to finish.}
  269. !
  270. !----------------------------------------------------------------------
  271. !
  272. !----------------------------------------------------------------------
  273. !
  274. -LABEL 17               { System Ready ... All is well }
  275. Pause 60
  276. DsplyMsg "Step 7:  Checking Password…"
  277. Exit 0
  278. !
  279. !----------------------------------------------------------------------
  280. !
  281. -Label 18               { User aborted sequence }
  282. Exit -51
  283. !
  284. -Label 19               { User aborted sequence...dont need to hang up thou}
  285. Exit -111
  286. !
  287. !----------------------------------------------------------------------
  288. !
  289. -Label 26              {Busy phone}
  290. IfEq ~ATMP 0
  291. DsplyMsg "The number dialed is busy. Trying second number."
  292. Talert "All phone lines are currently busy. \0DPlease wait a few minutes and try again.\0D"
  293. Jump "36"
  294. !
  295. !----------------------------------------------------------------------
  296. !
  297. -Label 27              {No Answer}
  298. IfEq ~ATMP 0
  299. DsplyMsg "The number dialed is not answering. Trying second number."
  300. TAlert "Error: Your access number is not answering or responding.\0DPlease take the following steps:\0D\0D1) Wait a few moments and try again.\0D2) Choose Get Local # from your Locality list and verify your access numbers."
  301. IfEq ~ATMP 1
  302. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  303. Exit -1
  304. !
  305. !----------------------------------------------------------------------
  306. !
  307. -Label 28              {Noisy line}
  308. Talert "There is noise on your phone line.\0DPlease try again.\0D"
  309. Jump "36"
  310. !
  311. !----------------------------------------------------------------------
  312. !
  313. -Label 29              {acct bad}
  314. Talert "Unable to verify account information.\0D\0D"
  315. Jump "36"
  316. !
  317. !----------------------------------------------------------------------
  318. !
  319. -Label 30              {disk problem}
  320. Talert "There was an error in reading your ~APPL disk.  Please try again.\0D"
  321. Jump "36"
  322. !
  323. !----------------------------------------------------------------------
  324. -Label 31              {acct aleady on}
  325. Talert "Please wait a few minutes and try again.\0D\0D"
  326. Jump "36"
  327. !
  328. !----------------------------------------------------------------------
  329. !
  330. -Label 32              {not_avail}
  331. TAlert "Error: Unable to connect through this access number at this time.\0DPlease take the following steps:\0D\0D1) Wait a few moments and try again.\0D2) Choose Get Local # from the Locality list for an alternate access #."
  332. IfEq ~ATMP 1
  333. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  334. Exit -1
  335. !
  336. !----------------------------------------------------------------------
  337. !
  338. -Label 33              {generic}
  339. TAlert "General Modem Error.\0DPlease take the following steps:\0D\0D1) Verify your modem and phone cable connections.\0D2) If possible, System 7 users Re-start with extensions off.(Re-start while holding down the shift key)"
  340. IfEq ~ATMP 1
  341. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  342. Exit -1
  343. !
  344. !----------------------------------------------------------------------
  345. !
  346. -Label 34               {db_error}
  347. Talert "There is a bad ~APPL file on your disk.\0D\0D"
  348. Jump "36"
  349. !
  350. !----------------------------------------------------------------------
  351. !
  352. -Label 35
  353. Exit -1
  354. !
  355. !----------------------------------------------------------------------
  356. !
  357. -Label 36
  358. IfEq ~ATMP 1
  359. OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
  360. Exit -1
  361. !
  362. !------------------------------------
  363. -Label CheckPhoneLength
  364. !
  365. NewString sPhoneNumber
  366. SetVar sPhoneNumber ~FONE
  367. NewLngInt lCount
  368. SetVar lCount 6
  369. !
  370. -Label TopPhoneLoop
  371. IfEq lCount 0
  372. Jump "FinishPhoneLength"
  373. DecVar sPhoneNumber
  374. DecVar lCount
  375. Jump "TopPhoneLoop"
  376. !
  377. -Label FinishPhoneLength
  378. IfEq sPhoneNumber ""
  379. Jump "EmptyPhone"
  380. Return
  381. !
  382. -Label EmptyPhone
  383. OneAlert 1 "You must enter phone numbers before signing on.\0D\0DSelect ""Setup"" and verify the phone numbers you have entered."
  384. Exit -111
  385. !------------------------------------
  386. !
  387. *-Label 0                {Hangup Sequence}
  388. *CanBtn "2"
  389. *ChrDelay 2
  390. !
  391. *Flush
  392. !
  393. *ClrMchStr
  394. *MatchStr "1" "OK"         { Dont look for an echo first time, maybe a}
  395. *MatchStr "1" "NO"         { false echo.  Any type of match is good}
  396. *MatchStr "1" ">"          { Special case for Avatex 1200 modems}
  397. !
  398. *Pause 180               { Pause for 3 sec min gap }
  399. *Xmit "+++"              { Get the modems attention}
  400. *Pause 180               { Pause for 3 sec min gap }
  401. !
  402. *ClrMchStr
  403. *MatchStr "1" "OK"
  404. *MatchStr "2" "CARRIER" {Any type of match is good}
  405. *MatchStr "1" "+++"
  406. *MatchStr "1" ">"          { Special case for Avatex 1200 modems}
  407. !
  408. *Pause 180               { Pause for 3 sec min gap }
  409. *Xmit "+++"              { Get the modems attention}
  410. *Pause 180               { Pause for 3 sec min gap }
  411. !
  412. *-Label 1
  413. *ClrMchStr
  414. *MatchStr "2" "ERROR"
  415. *MatchStr "2" "OK"
  416. *MatchStr "2" "CARRIER"
  417. *MatchStr "2" ">"          { Special case for Avatex 1200 modems}
  418. !
  419. *Pause 40
  420. *Xmit "$ATTENTION$H\0D"
  421. *Wait 300
  422. !
  423. *-Label 2
  424. *Pause 40                { Allow modem to settle between commands.}
  425. *ZMIT "3" "$ATTENTION$$REST$\0D"         { Send shutdown string}
  426.  
  427. *-Label 3
  428. *Exit 0
  429. !
  430. ###
  431.